package tum0r.server.problem;

import tum0r.model.ProblemInformation;
import tum0r.webengine.model.server.EngineFile;
import tum0r.webengine.model.server.ErrorMessage;
import tum0r.webengine.utils.server.action.Action;

public abstract class ProblemBase {
    /**
     * 题目信息
     */
    protected ProblemInformation information = new ProblemInformation();
    public ProblemInformation getInformation(){
        return information;
    }

    /**
     * 获取题目信息
     */
    public void info(Action<ProblemInformation> action){
        action.callBack(information);
    }

    /**
     * 获取题目描述
     */
    public abstract void description(Action<String> action);

    /**
     * 获取提示
     */
    public abstract void tips(Action<String> action);

    /**
     * 获取Write Up
     */
    public abstract void writeUp(Action<String> action);

    /**
     * 获取Write Up文件
     */
    public void writeUpFile(Action<EngineFile> action) throws ErrorMessage {
        action.check(true, "无Write Up文件");
    }
}
